package com.whfc.ms.api.fse.controller;

import com.whfc.common.result.ListData;
import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.common.util.SessionAttr;
import com.whfc.fuum.entity.SysUser;
import com.whfc.fvs.dto.FvsDeviceDTO;
import com.whfc.ms.api.fse.service.MsFseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author qzexing
 * @version 1.0
 * @date 2020-12-22 18:07
 */
@RestController
@RequestMapping("/ms/api/fse")
public class FseVideoController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private MsFseService msFseService;

    @GetMapping(value = "/fvs/list")
    public Result fvsList(@SessionAttribute(SessionAttr.MS_USER) SysUser user,
                          @RequestParam("deptId") Integer deptId) {
        logger.info("特种设备获取监控列表,loginer:{},deptId:{}",
                user.getUsername(), deptId);
        List<FvsDeviceDTO> list = msFseService.getFvsList(deptId);
        return ResultUtil.success(new ListData<>(list));
    }

}
